// Created by Administrator on 2015/11/29.

div.bar
    div.container
        nav.navbar.right.navbar-link(role='navigation')
            ul.navigation.navbar-nav
                if(login_user)
                    li: a(href='/user/#{login_user.nick}' target='_blank') #{login_user.nick}
                            b.caret
                    li |
                    li: a(href='/logout') 注销
                    li |
                else
                    li: a(href='/login' target='_blank') 登录
                    li: a(href='/register' target='_blank') 注册
                li: a 手机秀厨
                        b.caret
                li |
                li: a 关注秀厨
                        b.caret
                li |
                li: a 客户服务
                        b.caret
                li |
                li: a 网站导航
                        b.caret
div
    div.container
        div.logo
            a(href='/')
        div.searcher(ng-controller='retrieval')
            form(action='/searcher' method='GET' name='searcher')
                div.input-group
                    div(style='position:relative;display:table-cell;float:left;margin:0;padding:0;width:100%;' ng-init='show=false')
                        if qr
                            input.form-control(type='text' id='searcher' name='qr' placeholder='素菜' ng-focus='suggest()'
                            ng-blur='show=over' autocomplete='off' ng-change='suggest()' ng-model='qr' ng-init='qr="#{qr}"')
                        else
                            input.form-control(type='text' id='searcher' name='qr' placeholder='素菜' ng-focus='suggest()'
                            ng-blur='show=over' autocomplete='off' ng-change='suggest()' ng-model='qr')
                        ul.suggests.dropdown-menu(ng-class='{"block":show}' ng-mouseover='over=true' ng-mouseleave='over=false')
                            li(ng-repeat="suggest in suggests" ng-click="$parent.submit(suggest.field)") {{suggest.field}}
                                span(style='float:right;font-size:11px;padding-top:3px') 约{{suggest.count}}个商品
                            li.suggests-close(ng-click='show=false')
                                span 关闭
                    span.input-group-btn
                        button.btn.btn-searcher(type='button' ng-click='submit()') 搜索
            div.relation
                a 素菜
                a 家常菜
                a 炒菜
                a 糕点
                a 火锅
                a 泡菜
mixin catalog-list
    li(ng-repeat='(n, v) in categories' data-index='{{n}}' ng-mouseover='$parent.over($event)' ng-mouseleave='$parent.leave($event)')
        a {{v.name}}
div.catalog(ng-controller='catalog' ng-init='getCategories()' )
    div.container
        nav.navbar.navbar-default(role='navigation')
            div.navbar-header
                if path == '/'
                    a.navbar-brand(href='/catalog' target='_blank') 全部商品分类
                    ul.dropdown-catalog
                        +catalog-list
                else
                    a.navbar-brand(href='/catalog' target='_blank' ng-mouseover='showable=true' ng-mouseleave='showable=false' ng-init='showable=false') 全部商品分类
                    ul.dropdown-catalog(ng-mouseover='showable=true' ng-mouseleave='showable=false' ng-show='showable')
                        +catalog-list
                div.hidden-catalog(data-index='{{cname}}' ng-mouseover='showable=true;over($event) ' ng-mouseleave='leave($event);showable=false')
                    ul.panel-right.horizontal-menu
                        li(ng-repeat='child in children')
                            a(href='/search?cid={{child.id}}') {{child.name}}

            ul.nav.navbar-nav
                li: a(href='/') 首页
                li: a(href='/recipe' target='_blank') 菜谱
                li: a(href='/menu/popularMenus' target='_blank') 菜单
